from tools.OperationError import OperationError
from webapp.fastapi.annotations import *
from tools import weather
from flask import render_template, jsonify


def hello(id: (Positive, NoTrim)):
    """
    用于获取欢迎用户的提示语
    :param name: 用户名称, 可空
    :return: name 欢迎进入
    """
    return "%s 欢迎进入" % id

def hello2(id):
    """
    用于获取欢迎用户的提示语
    :param name: 用户名称, 可空
    :return: name 欢迎进入
    """
    return "%s 欢迎进入" % id

def index():
    """
    用于获取首页功能模块
    """
    raise OperationError(300, "xxxx", response_status=-1)

def weather():
    response = weather.getweather()
    return jsonify(response)
